<!DOCTYPE html>
<html lang="zh-CN">
<!--引入thymeleaf标签-->
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>录入学生信息</title>
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
  <style>
    .main {
      margin-top: 100px;
    }
  </style>
</head>

<!--
   <td th:switch="${s.syr}">
   <span th:case="1" th:text="男"></span>
   <span th:case="2" th:text="女"></span>
</td>
-->

<body>
  <!-- 导航栏 -->
  <nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
      <div class="navbar-header">
        <a class="navbar-brand" href="#">测试项目</a>
      </div>
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
          <li ><a href="/index">学生信息</a></li>
          <li class="active"><a href="#add">录入学生</a></li>
          <li><a href="#about">关于</a></li>
          <li><a href="#contact">联系</a></li>
        </ul>
      </div>
    </div>
  </nav>
  <div class="container main">
    <form method="post" action="/look/user">
      <div class="form-group">
        <label for="recipient-name" class="control-label">姓名:</label>
        <input type="text" class="form-control" id="recipient-name" name="name">
      </div>
      <div class="form-group">
        <label for="recipient-sex" class="control-label">性别:</label>
        <input type="text" class="form-control" id="recipient-sex" name="sex">
      </div>
      <div class="form-group">
        <label for="recipient-phone" class="control-label">电话:</label>
        <input type="text" class="form-control" id="recipient-phone" name="phone">
      </div>
      <div class="form-group" >
        <label for="recipient-class" class="control-label">班级:</label>
        <select  name="gName"  class="form-control" id="recipient-class" style="width:100% !important">
<!--           th:value="${grad.id}-->
        <option th:each="grad : ${grade}"   th:text="${grad.name}"></option>
        </select>
      </div>
      <div class="form-group">
        <label for="recipient-class" class="control-label">选修:</label>
<!--      class="form-control"      样式
          id="recipient-class"
 -->
        <select name="eName"  class="form-control" id="recipient-class" style="width:100% !important">
<!--          改成动态的-->
<!--          前端接收一个集合： 使用for-each  th来循环-->
<!--          th:id="${el.id}" name="gr"-->
          <option th:each="el : ${elective}" th:text="${el.name}" ></option>
        </select>
      </div>
      <div class="form-group">
        <label for="message-text" class="control-label">地址:</label>
        <textarea class="form-control" id="message-text" name="address"></textarea>
      </div>
      <div class="form-group">
        <input class="btn btn-primary" type="submit" value="Submit">
      </div>
    </form>
  
  </div>

<!--  引入标签-->
  <script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js"></script>
</body>

</html>